﻿using HuiLian.Data.DataAccess.Implement;
using HuiLian.Data.DataAccess.Interface;
using HuiLian.Model.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HuiLian.Data.DataAccess.Base
{
    public class DBDao
    {
        private static IUserDao userDao = null;
        /// <summary>
        /// 用户接口
        /// </summary>
        public static IUserDao UserDao
        {
            get
            {
                if (userDao == null)
                {
                    userDao = new UserDaoImpl();
                }
                return userDao;
            }
        }

        private static IFoodDao foodDao = null;
        /// <summary>
        /// 商品接口
        /// </summary>
        public static IFoodDao FoodDao
        {
            get
            {
                if (foodDao == null)
                {
                    foodDao = new FoodDaoImpl();
                }
                return foodDao;
            }
        }

        private static IOrderDao orderDao = null;
        /// <summary>
        /// 订单接口
        /// </summary>
        public static IOrderDao OrderDao
        {
            get
            {
                if (orderDao == null)
                {
                    orderDao = new OrderDaoImpl();
                }
                return orderDao;
            }
        }

        private static IOrderItemDao orderItemDao = null;
        /// <summary>
        /// 订单条目接口
        /// </summary>
        public static IOrderItemDao OrderItemDao
        {
            get
            {
                if (orderItemDao == null)
                {
                    orderItemDao = new OrderItemDaoImpl();
                }
                return orderItemDao;
            }
        }

    }
}
